<template>
  <div>
    456
    <!-- 原始获取store里面的值 -->
    {{ $store.state.userInfo.name }}今年{{ $store.state.userInfo.age }}岁了
    <h1>{{ name }}今年{{ age }}</h1>
  </div>
</template>
<script>
export default {
  computed: {
    name() {
      return this.$store.state.userInfo.name;
    },
    age() {
      return this.$store.state.userInfo.age;
    },
  },
};
</script>